<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="../../src/images/bitbug_favicon.ico" type="image/x-icon">
  <meta name="keywords" content="your keywords">
  <meta name="description" content="your description">
  <meta name="author" content="author,email address">
  <meta name="robots" content="index,follow">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>仁和区党群服务一号通暨群众意见受理中心</title>
  <link rel="stylesheet" href="../../src/css/base.css">
  <link rel="stylesheet" href="../../src/css/common.css">
  <link rel="stylesheet" href="../../src/css/tpl.css">
  <link rel="stylesheet" href="../../src/css/user_center.css">
  <link rel="stylesheet" href="../../src/css/Feedback.css">
  <script src="../../src/js/libs/es5-shim.min.js"></script>
  <script src="../../src/js/libs/es5-sham.min.js"></script>
  <script src="../../src/js/libs/json3.min.js"></script>
</head>

<body>
  <div class="page">
    <div id="header">
    </div>
    <div class="menu-bar">
      <div class="container">
        <span>
        <span class="crumb-name">当前你的位置：</span>>
        </span>
        <span>
             <a href="../Home/Index.html">首页</a>>
      </span>
        <span>
        <a class="" href="">来件查询</a>
      </span>
      </div>
    </div>

    <div class="mid_container clearfix">
      <div class="left_guide">
        <h1 class="left_guide_top_size">
          在线民声
        </h1>
        <div class="left_guide_decorate">
        </div>
        <div class="left_about_us">
          THE VOICE OF THE PEOPLE
        </div>
        <div class="left_white_about">
          <a href="Goldidea.html" class="left_white_bottom"><span class="left_cn_about_us">金点子</span></a>
        </div>
        <div class="left_white_about">
          <a href="Feedback.html" class="left_white_bottom"><span class="left_cn_about_us">建议意见</span></a>
        </div>
        <div class="left_white_about">
          <a href="Notice.html" class="left_white_bottom"><span class="left_cn_about_us">民生投诉</span></a>
        </div>
        <div class="left_white_about">
          <a href="SJMailbox.html" class="left_white_bottom"><span class="left_cn_about_us">书记信箱</span></a>
        </div>
        <div class="left_white_about">
          <a href="QZMailbox.html" class="left_white_bottom"><span class="left_cn_about_us">区长信箱</span></a>
        </div>
        <div class="left_white_about active">
          <a href="Demanfar.html" class="left_white_bottom"><span class="left_cn_about_us">来件查询</span></a>
        </div>
      </div>
      <div class="mid_guide">
        <div class="mid_guide_content">
          <div class="content clearfix" id="table_html">
          </div>
          <div id="page1" class="laypage"></div>
        </div>
      </div>
    </div>
  </div>
  <div id="footer">
  </div>
  <script type="text/html" id="table_tpl">
    <table class="other_table">
      <tr class="tr-tit">
        <th>信件标题</th>
        <th style="width:90px">信件类型</th>
        <th style="width:120px">信箱</th>
        <th style="width:90px">来信人</th>
        <th style="width:120px">来信日期</th>
        <th style="width:120px">状态</th>
      </tr>
      {{each resultdata val idx}}
      <tr>
        <td class="tl">
          <div class="td_1 fof"><a href="../Feedback/LetterDetail.html?{{val.id}}">{{val.title}}</a></div>
        </td>
        <td class="tc">{{val.appealtype | _appealtype}}</td>
        <td class="tc">{{val.source | _source}}</td>
        <td class="tc">
          <div class="fof" style="width:90px;">{{val.username}}</div>
        </td>
        <td class="tc">{{val.createtime.split(' ')[0]}}</td>
        <td class="tc">{{val.status | _status}}</td>
      </tr>
      {{/each}}
    </table>
  </script>
  <script src="../../src/js/libs/jquery.1.12.4.js"></script>
  <script src="../../src/js/libs/template-web.js"></script>
  <script src="../../src/js/libs/laypage/laypage.js"></script>
  <script src="../../src/js/base/common.js"></script>
  <script>
    var params = {
      page: 1
    }
    var pageindex = 4

    getList(params.page)

    function getList(page) {
      $.ajax({
        url: 'http://221.10.2.222:5680/api/ow/Complain/Far/List/',
        type: "GET",
        dataType: "json",
        data: {
          'ispublic': 1,
          'page': page,
          'pagesize': 20
        },
        success: function (res) {
          console.log(res)
          res.resultdata = JSON.parse(res.resultdata)
          var table = template('table_tpl', res)
          $('#table_html').html(table)
          laypage({
            cont: 'page1',
            pages: Math.ceil(res.count / 10),
            curr: page || 1,
            first: false,
            last: false,
            prev: '<',
            next: '>',
            jump: function (obj, first) {
              window.scrollTo(0, 300)
              if (!first) {
                getList(obj.curr);
              }
            }
          });
        },
        error: function (e) {}
      })
    }


    template.defaults.imports._appealtype = function (val) {
      var arr = ['投诉', '监督', '举报', '曝光', '表扬', '建议', '其他', '咨询']
      val = parseInt(val) - 1
      return arr[val] ? arr[val] : '其他'
    };

    template.defaults.imports._status = function (val) {
      var arr = ['待处理', '待审核', '处理中', '待评价', '已完结', '已取消', '网格化管理员待处理', '网格化管理员已处理', '审核失败']
      if (val == 1 || val == 2 || val == 3 || val == 7) {
        return '办理中'
      } else {
        return '已办结'
      }
    };

    template.defaults.imports._source = function (val) {
      var arr = ['热线', 'APP', '官网', '微信', '书记信箱', '区长信箱', '市12345', '地方领导留言板', '微博']
      val = parseInt(val) - 1
      return arr[val] ? arr[val] : '其他'
    };

    template.defaults.imports._score = function (val) {
      var arr = [, '不满意', '满意', '满意', '满意', '非常满意']
      val = parseInt(val) - 1
      return arr[val] ? arr[val] : '未评价'
    };
  </script>
</body>

</html>